from pathlib import Path
import sys

# ================== 配置区 ==================
UPDATE_CONFIG = {
    "version_url": "http://115.120.195.74/latest.json",
    "timeout": 8,
}

# 路径初始化
APP_ROOT = Path(__file__).parent if not getattr(sys, 'frozen', False) else Path(sys.executable).parent
CURRENT_EXE = Path(sys.executable).resolve()

UPDATE_TEMP_DIR = APP_ROOT / "update_temp"
UPDATE_TEMP_DIR.mkdir(exist_ok=True)
TEMP_ZIP_FILE = UPDATE_TEMP_DIR / f"update_{CURRENT_EXE.stem}.zip"
TEMP_UNZIP_DIR = UPDATE_TEMP_DIR / f"update_{CURRENT_EXE.stem}_temp"